package test.image;

import javax.swing.*;
import java.awt.*;

/**
 * @Auther leiHua
 * @Date 2022/5/12 19:31
 */
public class ImageDemo  {
    public static void main(String[] args) {
        ImageIcon imag1 = new ImageIcon("src/imag/1.jpg");
        imag1.setImage( imag1.getImage().getScaledInstance(100, 500, Image.SCALE_DEFAULT));

        JFrame jf = new JFrame();
        JLabel jLabel = new JLabel(imag1);

        JPanel jPanel = new JPanel();
//        jPanel.add(jLabel);

        jf.add(jLabel);
        jf.setVisible(true);

        jf.pack();


    }

}
